//
//  BindCardNextViewController.h
//  PlayBall
//
//  Created by Edward Zhang on 12-5-7.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "JddBaseViewController.h"
#import "JddPickerView.h"
#import "JddQueryProviceListOperation.h"
#import "JddQueryCityListOperation.h"
#import "JddQueryBankListOperation.h"
#import "JddQueryBranchBankListOperation.h"
#import "JddBindCardOperation.h"

enum  {
    PICKERVIEW_MODE_NONE = 0,
    PICKERVIEW_MODE_PROVINCE,
    PICKERVIEW_MODE_CITY,
    PICKERVIEW_MODE_BANK,
    PICKERVIEW_MODE_BRANCH_BANK
    };

@interface JddBindCardNextViewController : JddBaseViewController<JddPickerViewDelegate, UIPickerViewDataSource, UIPickerViewDelegate, UITextFieldDelegate, UIGestureRecognizerDelegate, QueryProviceListOperationDelegate, QueryCityListOperationDelegate, QueryBankListOperationDelegate, QueryBranchBankListOperationDelegate, UITableViewDelegate, UITableViewDataSource>{//BindCardOperationDelegate
    
@private
    NSInteger       pickerViewMode;
    NSMutableArray *provinceArray;
    NSMutableArray *cityDictionary;
    NSMutableArray *cityArray;
    NSMutableArray *bankArray;
    NSMutableArray *branchBankArray;
    BOOL            provinceSelected;
    BOOL            citySelected;
    BOOL            bankSelected;
}

SHARED_VIEW_CONTROLLER_DECLARE(JddBindCardNextViewController);

@property (strong, nonatomic) JddPickerView *cardInfoPickerView;
@property (strong, nonatomic) IBOutlet UIScrollView  *bgScrollView;
@property (strong, nonatomic) IBOutlet UITextField   *cardNumberTextField;
@property (strong, nonatomic) IBOutlet UITableView   *selectBankTableView;

@property (strong, nonatomic) IBOutlet UILabel       *cardOwnerLabel;
@property (strong, nonatomic) NSString               *province;
@property (strong, nonatomic) NSString               *city;
@property (strong, nonatomic) NSString               *bank;
@property int               bankId;
@property (strong, nonatomic) NSString               *branchBank;

@property (strong, nonatomic) IBOutlet UIButton      *okButton;
@property (strong, nonatomic) IBOutlet UITextField *realityName;

- (IBAction)provinceButtonClicked:(id)sender;
- (IBAction)cityButtonClicked:(id)sender;
- (IBAction)branchBankButtonClicked:(id)sender;
- (IBAction)bankButtonClicked:(id)sender;
- (IBAction)bindButtonClicked:(id)sender;

- (IBAction)handleSingleTapGesture:(UITapGestureRecognizer*)sender;

- (void)setJddPickerViewHidden:(BOOL)hidden;

@end
